package com.project.service;

import com.project.dao.IUserDao;
import com.project.dao.impl.UserDaoImpl;
import com.project.server.Request;
import com.project.server.Response;
import com.project.server.Servlet;
import com.project.server.WebServlet;

/**
 * 修改业务组件
 */
@WebServlet("update")
public class UpdateService  implements Servlet {
    private IUserDao userDao = new UserDaoImpl();
    public void service(Request request, Response response){
        //得到表单数据
        int id = Integer.parseInt(request.getParameter("id"));
        String pwd = request.getParameter("pwd");
        int money = Integer.parseInt(request.getParameter("money"));

        //调用持久方法，完成修改
        userDao.update(id,pwd,money);
        FindAllService findAllService = new FindAllService();
        findAllService.service(request,response);
    }
}
